在数组中使用字符串
#include <cstring> // strlen() 方法
int main()
{
using namespace std;
const int Size= 15;
char name1[Size];
char name2[Size] = "C++owboy";
cout << "Howdy! I'm " << name2;
cout << strlen(name2) << " letters and is stored\n";
name2[3] = '\0';
cout << name2 << endl;
return 0;
}
🔚